<html>
<head><meta charset="utf-8"><title>negative impls in coherence · wg-traits · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/index.html">wg-traits</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html">negative impls in coherence</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="241074988"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/241074988" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#241074988">(Jun 01 2021 at 21:00)</a>:</h4>
<p><span class="user-mention" data-user-id="220273">@Jane Lusby</span> I'm making this topic for us to talk further</p>



<a name="241075462"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/241075462" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#241075462">(Jun 01 2021 at 21:04)</a>:</h4>
<p><span aria-label="+1" class="emoji emoji-1f44d" role="img" title="+1">:+1:</span></p>



<a name="241075801"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/241075801" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#241075801">(Jun 01 2021 at 21:07)</a>:</h4>
<p>to help with continuity<br>
previous convo: <a href="#narrow/stream/131828-t-compiler/topic/conflicting.20impls">https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/conflicting.20impls</a><br>
notes: <a href="https://hackmd.io/@nikomatsakis/HJLd4WE9O">https://hackmd.io/@nikomatsakis/HJLd4WE9O</a></p>



<a name="241075854"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/241075854" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#241075854">(Jun 01 2021 at 21:08)</a>:</h4>
<p>WIP PR: <a href="https://github.com/rust-lang/rust/pull/85764">https://github.com/rust-lang/rust/pull/85764</a></p>



<a name="241076069"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/241076069" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#241076069">(Jun 01 2021 at 21:09)</a>:</h4>
<p>the other question, which we didn't touch on, is what is needed from the lang team side</p>



<a name="241076108"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/241076108" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#241076108">(Jun 01 2021 at 21:10)</a>:</h4>
<p>I'm not sure!</p>



<a name="241076334"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/241076334" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#241076334">(Jun 01 2021 at 21:12)</a>:</h4>
<p>I think I will create a project propsal</p>



<a name="241076914"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/241076914" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#241076914">(Jun 01 2021 at 21:16)</a>:</h4>
<p><a href="https://github.com/rust-lang/lang-team/issues/96">https://github.com/rust-lang/lang-team/issues/96</a></p>



<a name="241077848"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/241077848" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#241077848">(Jun 01 2021 at 21:23)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence/near/241076914">said</a>:</p>
<blockquote>
<p><a href="https://github.com/rust-lang/lang-team/issues/96">https://github.com/rust-lang/lang-team/issues/96</a></p>
</blockquote>
<p>blessed, ty</p>



<a name="241077911"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/241077911" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#241077911">(Jun 01 2021 at 21:24)</a>:</h4>
<p>minor typo in the motivating examples</p>



<a name="241077931"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/241077931" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#241077931">(Jun 01 2021 at 21:24)</a>:</h4>
<p>should be <code>From&lt;&amp;str&gt; for Box&lt;dyn Error&gt;</code> but it's reversed</p>



<a name="241078132"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/241078132" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#241078132">(Jun 01 2021 at 21:26)</a>:</h4>
<p>ah yeah</p>



<a name="241089407"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/241089407" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#241089407">(Jun 01 2021 at 23:41)</a>:</h4>
<p>part of the idea with the new PredicateKind is to change existing negative impls that used to get exposed in <code>predicates</code> as <code>PredicateKind::Trait</code> to <code>PredicateKind::NotTrait</code> right? As in it's not just to have the representation available so we can invert actual impls when doing the overlap check.</p>



<a name="241089513"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/241089513" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#241089513">(Jun 01 2021 at 23:43)</a>:</h4>
<p>trying to figure out what "teach the trait checker to prove <code>T: !Trait</code> if there are negative impls" entails and starting with making it so negative impls show up as <code>PredicateKind::NotTrait</code> in <code>overlap_within_probe</code></p>



<a name="241089933"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/241089933" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#241089933">(Jun 01 2021 at 23:49)</a>:</h4>
<p>ended up digging pretty deep into <a href="http://collect.rs">collect.rs</a> but started to second guess by the time I got to <code>gather_explicit_predicates_of</code></p>



<a name="241145952"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/241145952" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#241145952">(Jun 02 2021 at 13:11)</a>:</h4>
<p><span class="user-mention" data-user-id="220273">@Jane Lusby</span> I hadn't quite figured out what shape I thought that should have</p>



<a name="241145976"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/241145976" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#241145976">(Jun 02 2021 at 13:11)</a>:</h4>
<p>this is also connected (a bit) to the semantics of auto traits and negative impls</p>



<a name="241145990"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/241145990" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#241145990">(Jun 02 2021 at 13:11)</a>:</h4>
<p>something that <span class="user-mention" data-user-id="216206">@lcnr</span> and I were discussing recently</p>



<a name="241146037"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/241146037" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#241146037">(Jun 02 2021 at 13:12)</a>:</h4>
<p>I think my expectation is that we would not change <a href="http://collect.rs">collect.rs</a></p>



<a name="241146058"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/241146058" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#241146058">(Jun 02 2021 at 13:12)</a>:</h4>
<p>I would expect to change how we manage candidates a bit</p>



<a name="241146255"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/241146255" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#241146255">(Jun 02 2021 at 13:13)</a>:</h4>
<p>I'm pulling up the relevant code</p>



<a name="241146489"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/241146489" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#241146489">(Jun 02 2021 at 13:15)</a>:</h4>
<p>basically, where <code>candidate_from_obligation_no_cache</code> invokes <code>filter_negative_and_reservation_impls</code> and so forth</p>



<a name="241146501"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/241146501" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#241146501">(Jun 02 2021 at 13:15)</a>:</h4>
<p>I think we might tweak this a bit</p>



<a name="241146517"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/241146517" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#241146517">(Jun 02 2021 at 13:15)</a>:</h4>
<p>so that there is a "negative candidate" and a "positive candidate" function</p>



<a name="241146586"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/241146586" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#241146586">(Jun 02 2021 at 13:16)</a>:</h4>
<p>it's still a bit odd that we assemble both polarities together into one list, but I think it's "ok"</p>



<a name="241595032"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/241595032" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#241595032">(Jun 04 2021 at 21:24)</a>:</h4>
<p>hmm, went to do this but I'm a bit confused. I don't understand how <code>overlap_within_probe</code> is related to <code>candidate_from_obligation_no_cache</code> or how messing with the candidates in the latter will affect the predicates exposed in the latter</p>



<a name="241595977"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/241595977" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#241595977">(Jun 04 2021 at 21:36)</a>:</h4>
<p>okay so, I think I found the connection, obvious in retrospect, <code>candidate_from_obligation</code> is a method on SelectionContext which is an arg in <code>overlap_within_probe</code></p>



<a name="241596514"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/241596514" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#241596514">(Jun 04 2021 at 21:43)</a>:</h4>
<p>I think it has to be via <code>predicate_may_hold_fatal</code> but I still haven't figured out how that ends up calling <code>select</code></p>



<a name="241597217"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/241597217" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#241597217">(Jun 04 2021 at 21:51)</a>:</h4>
<p>tried tracing backwards through the callers of <code>predicate_may_hold_fatal</code> but dead ended at the <code>FulfillmentContext::select</code></p>



<a name="241597772"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/241597772" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#241597772">(Jun 04 2021 at 21:58)</a>:</h4>
<p>oh shit i think I found it in InferContext</p>



<a name="241598262"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/241598262" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#241598262">(Jun 04 2021 at 22:04)</a>:</h4>
<p>well, maybe not, but I have a better idea of how they relate, if not understanding the exact series of calls from one to the other</p>



<a name="241598736"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/241598736" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#241598736">(Jun 04 2021 at 22:07)</a>:</h4>
<p>oh my god, I think i get it, I'm negating the obligation which is an input into candidate_from_obligation</p>



<a name="241598944"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/241598944" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#241598944">(Jun 04 2021 at 22:09)</a>:</h4>
<p>wait so is the idea that we'd have a <code>filter_negative_and_reservation_impls</code> and a <code>filter_positive_and_reservation_impls</code> and when the obligation has been negated we call the <code>filter_positive</code> version instead of <code>filter_negative</code>?</p>



<a name="242783080"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/242783080" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#242783080">(Jun 15 2021 at 19:03)</a>:</h4>
<p><span class="user-mention" data-user-id="220273">@Jane Lusby</span> sorry, last week I was basically afk all week, how are you doing here?</p>



<a name="242785254"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/242785254" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#242785254">(Jun 15 2021 at 19:19)</a>:</h4>
<p>Haven't picked it back up since my last msgs</p>



<a name="245351664"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/245351664" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#245351664">(Jul 08 2021 at 18:22)</a>:</h4>
<p>finally picking this back up again</p>



<a name="245360405"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/245360405" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#245360405">(Jul 08 2021 at 19:32)</a>:</h4>
<p>we should probably find some good time to chat about it</p>



<a name="245366452"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/245366452" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#245366452">(Jul 08 2021 at 20:18)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence/near/245360405">said</a>:</p>
<blockquote>
<p>we should probably find some good time to chat about it</p>
</blockquote>
<p>my day is wide open today if you have time</p>



<a name="245441640"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/245441640" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#245441640">(Jul 09 2021 at 13:17)</a>:</h4>
<p><span class="user-mention" data-user-id="220273">@Jane Lusby</span> is your day open today? Otherwise, let's schedule a time next week</p>



<a name="245441656"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/245441656" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#245441656">(Jul 09 2021 at 13:17)</a>:</h4>
<p>I'm not sure about today, it's starting to fill up</p>



<a name="245441853"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/245441853" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#245441853">(Jul 09 2021 at 13:18)</a>:</h4>
<p>Today's my "commute to the office day" so not really open</p>



<a name="245441884"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/245441884" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#245441884">(Jul 09 2021 at 13:19)</a>:</h4>
<p>My Monday next week is pretty open though</p>



<a name="246165721"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/246165721" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#246165721">(Jul 15 2021 at 22:49)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> I changed up <a href="https://github.com/rust-lang/rust/pull/85764/">https://github.com/rust-lang/rust/pull/85764/</a> to properly negate the obligation and to thread the polarity through as a member rather than an alternate PredicateKind</p>



<a name="246165761"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/246165761" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#246165761">(Jul 15 2021 at 22:49)</a>:</h4>
<p>and now im getting ready to setup the inverse of <code>filter_negative_and_reservation_impls</code> and thread the polarity through the <code>TraitPredicate</code></p>



<a name="246165779"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/246165779" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#246165779">(Jul 15 2021 at 22:49)</a>:</h4>
<p>and I'm unsure of where exactly I should put the polarity</p>



<a name="246165786"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/246165786" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#246165786">(Jul 15 2021 at 22:49)</a>:</h4>
<p>my guesses are either in the <code>TraitPredicate</code> or in the <code>TraitRef</code></p>



<a name="246165792"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/246165792" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#246165792">(Jul 15 2021 at 22:49)</a>:</h4>
<p>but not sure which one to pick</p>



<a name="246166187"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/246166187" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#246166187">(Jul 15 2021 at 22:54)</a>:</h4>
<p>gonna put it in traitpredicate</p>



<a name="246166190"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/246166190" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#246166190">(Jul 15 2021 at 22:54)</a>:</h4>
<p>seems more appropriate</p>



<a name="246166193"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/246166193" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#246166193">(Jul 15 2021 at 22:54)</a>:</h4>
<p>yoloo</p>



<a name="246232601"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/246232601" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#246232601">(Jul 16 2021 at 14:46)</a>:</h4>
<p><span class="user-mention" data-user-id="220273">@Jane Lusby</span> that is correct</p>



<a name="246232620"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/246232620" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#246232620">(Jul 16 2021 at 14:46)</a>:</h4>
<p>TraitRef is a more "primitive" concept</p>



<a name="246232638"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/246232638" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#246232638">(Jul 16 2021 at 14:46)</a>:</h4>
<p><code>TraitPredicate</code> is <em>perfect</em></p>



<a name="246232656"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/246232656" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#246232656">(Jul 16 2021 at 14:47)</a>:</h4>
<p>TraitPredicate is basically "what you want to prove" -- either that the trait <em>is</em> or <em>is not</em> implemented</p>



<a name="246254685"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/246254685" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#246254685">(Jul 16 2021 at 17:35)</a>:</h4>
<p>perfect. Okay then I think I have that sorted already, there's a lot of places where I wasn't sure how to properly thread in the Polarity so I defaulted it to just assuming positive. The place that I saw it was creating a TraitPredicate from a PredicateKind I used the existing polarity and I'm hoping that's the only place I actually needed to thread it through. Other than that I think I may only need to setup the inverted <code>filter_negative_and_reservation_impls</code> but I'm currently unclear on how exactly to implement that and need to get a better understanding of the existing logic and what each of the return paths mean in practice.</p>



<a name="246308254"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/246308254" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#246308254">(Jul 17 2021 at 06:24)</a>:</h4>
<p><span class="user-mention" data-user-id="220273">@Jane Lusby</span> that sounds <em>reasonable</em>, at least at first glance</p>



<a name="246308281"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls%20in%20coherence/near/246308281" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.20in.20coherence.html#246308281">(Jul 17 2021 at 06:25)</a>:</h4>
<p>I am imagining that this becomes <code>filter_reserved_or_opposite_polarity_impls</code> -- but the question is, did you also add the polarity into the <code>TraitObligationStack</code> somewhere?</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>